import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by lancf on 2019/6/24.
 */
public class Test1 {

    public static void main(String[] args) throws Exception {

        SimpleDateFormat myFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = myFormatter.parse("2003-06-01 12:09:00");
        Date mydate = myFormatter.parse("2003-06-01 12:01:00");
        long day = (date.getTime() - mydate.getTime()) / (60 * 1000);


        Date mydate2 = myFormatter.parse("2019-06-24 17:15:00");
        long day2 = (System.currentTimeMillis() - mydate2.getTime()) / (60 * 1000);
        System.out.println("相差的日期: " + day);
        System.out.println("相差的日期2: " + day2);
    }
}
